OpenStack Queens : Configure Aodh
2018/03/17 |
Install OpenStack Alarming Service (Aodh).
This example is based on the emvironment like follows.
------------+---------------------------+---------------------------+------------ | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ Control Node ] | | [ Storage Node ] | | [ Compute Node ] | | | | | | | | MariaDB RabbitMQ | | Open_vSwitch | | Libvirt | | Memcached httpd | | L2_Agent | | Nova_Compute | | Keystone Glance | | L3_Agent | | Open_vSwitch | | Nova_API Cinder_API | | Metadata_Agent | | L2_Agent | | Neutron_Server | | Cinder_Volume | | Ceilometer_Compute | | Metadata_Agent | | Heat_API | | | | Gnocchi | | Heat Engine | | | | Ceilometer_Central | | | | | | Aodh_Evaluator | | | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] |
Install Gnocchi and Ceilometer first.
|
[2] | Add users and others for Aodh in Keystone. |
# add aodh user (set in service project) [root@dlp ~(keystone)]# openstack user create --domain default --project service --password servicepassword aodh +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | b1da1070c8af427886d0202f8bbe414f | | domain_id | default | | enabled | True | | id | b29873fbbe8947b7bac47ee3ade2fa97 | | name | aodh | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ # add aodh user in admin role [root@dlp ~(keystone)]# openstack role add --project service --user aodh admin
# add service entry for aodh [root@dlp ~(keystone)]# openstack service create --name aodh --description "Telemetry Alarming" alarming +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | Telemetry Alarming | | enabled | True | | id | 992242c1027c426eaf3c5724de9d1ada | | name | aodh | | type | alarming | +-------------+----------------------------------+ # define keystone host [root@dlp ~(keystone)]# export controller=10.0.0.30
# add endpoint for aodh (public) [root@dlp ~(keystone)]# openstack endpoint create --region RegionOne alarming public http://$controller:8042 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 10d1623faa4c432aa7665dbdc8c3a31b | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 992242c1027c426eaf3c5724de9d1ada | | service_name | aodh | | service_type | alarming | | url | http://10.0.0.30:8042 | +--------------+----------------------------------+ # add endpoint for aodh (internal) [root@dlp ~(keystone)]# openstack endpoint create --region RegionOne alarming internal http://$controller:8042 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 7ffda3d64b174ee3874e3f08f4b9bb91 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 992242c1027c426eaf3c5724de9d1ada | | service_name | aodh | | service_type | alarming | | url | http://10.0.0.30:8042 | +--------------+----------------------------------+ # add endpoint for aodh (admin) [root@dlp ~(keystone)]# openstack endpoint create --region RegionOne alarming admin http://$controller:8042 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 20b458836105469cadf7562b68d86209 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 992242c1027c426eaf3c5724de9d1ada | | service_name | aodh | | service_type | alarming | | url | http://10.0.0.30:8042 | +--------------+----------------------------------+ |
[3] | Add a User and Database on MariaDB for Aodh. |
[root@dlp ~(keystone)]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 71 Server version: 10.1.20-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
create database aodh; Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on aodh.* to aodh@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on aodh.* to aodh@'%' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) exit Bye |
[4] | Install Aodh. |
[root@dlp ~(keystone)]# yum --enablerepo=centos-openstack-queens,epel -y install openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer python2-aodhclient
|
[5] | Configure Aodh. |
[root@dlp ~(keystone)]# mv /etc/aodh/aodh.conf /etc/aodh/aodh.conf.org
[root@dlp ~(keystone)]#
vi /etc/aodh/aodh.conf # create new [DEFAULT] log_dir = /var/log/aodh # RabbitMQ connection info transport_url = rabbit://openstack:password@10.0.0.30 [api] auth_mode = keystone gnocchi_external_project_owner = service [database] # MariaDB connection info connection = mysql+pymysql://aodh:password@10.0.0.30/aodh # Keystone auth info [keystone_authtoken] www_authenticate_uri = http://10.0.0.30:5000 auth_url = http://10.0.0.30:5000 memcached_servers = 10.0.0.30:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = aodh password = servicepassword [service_credentials] auth_url = http://10.0.0.30:5000/v3 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = aodh password = servicepassword interface = internalURL
[root@dlp ~(keystone)]#
vi /etc/httpd/conf.d/20-aodh_wsgi.conf # create new Listen 8042 <VirtualHost *:8042> DocumentRoot "/var/www/cgi-bin/aodh" <Directory "/var/www/cgi-bin/aodh"> AllowOverride None Require all granted </Directory> CustomLog "/var/log/httpd/aodh_wsgi_access.log" combined ErrorLog "/var/log/httpd/aodh_wsgi_error.log" SetEnvIf X-Forwarded-Proto https HTTPS=1 WSGIApplicationGroup %{GLOBAL} WSGIDaemonProcess aodh display-name=aodh_wsgi user=aodh group=aodh processes=6 threads=3 WSGIProcessGroup aodh WSGIScriptAlias / "/var/www/cgi-bin/aodh/app" </VirtualHost> chmod 640 /etc/aodh/aodh.conf [root@dlp ~(keystone)]# chgrp aodh /etc/aodh/aodh.conf [root@dlp ~(keystone)]# mkdir /var/www/cgi-bin/aodh [root@dlp ~(keystone)]# cp /usr/lib/python2.7/site-packages/aodh/api/app.wsgi /var/www/cgi-bin/aodh/app [root@dlp ~(keystone)]# chown -R aodh. /var/www/cgi-bin/aodh [root@dlp ~(keystone)]# su -s /bin/bash aodh -c "aodh-dbsync" [root@dlp ~(keystone)]# systemctl start openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener [root@dlp ~(keystone)]# systemctl enable openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener [root@dlp ~(keystone)]# systemctl restart httpd |
[6] | If SELinux is enabled, change policy. |
[root@dlp ~(keystone)]# semanage port -a -t http_port_t -p tcp 8042 |
[7] | If Firewalld is running, allow service port. |
[root@dlp ~(keystone)]# firewall-cmd --add-port=8042/tcp --permanent success [root@dlp ~(keystone)]# firewall-cmd --reload success |